from datetime import datetime

from django.db import models

from app01.models import MuseumInfo, MuseumName


# Create your models here.
class UserInfo(models.Model):
    username = models.CharField(verbose_name='用户名', max_length=32)
    password = models.CharField(verbose_name='密码', max_length=32)
    email = models.EmailField(verbose_name='邮箱', max_length=32)
    mobile_phone = models.CharField(verbose_name='手机号', max_length=32)

    def __str__(self):
        return self.username


class CollectMuseum(models.Model):
    who_clt = models.ForeignKey(to=UserInfo, on_delete=models.CASCADE)
    clt_relation_museum = models.ForeignKey(to=MuseumInfo, on_delete=models.CASCADE)
    clt_time = models.DateTimeField(default=datetime.now)
